home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / muds / lpmud312.tar / lpmud312 / indentp.c < prev    next >
C/C++ Source or Header  |  1991-11-19  |  501b  |  32 lines

  1. #include <stdio.h>
  2.  
  3. extern char *strrchr();
  4. extern int system();    /* Could be char* for sprintf, but... */
  5.  
  6. int
  7. indent_program(name)
  8. char *name;
  9. {
  10.     char buf[1000];
  11.     char *p;
  12.  
  13.     p = strrchr(name, '/');
  14.     if (!p)
  15.     p = name;
  16.     else
  17.     p++;
  18. #ifndef MSDOS
  19.     (void) sprintf(buf, "%s/indent '%s' -lpc && rm '%s'.BAK", BINDIR, name, p);
  20.     return system(buf) == 0;
  21. #else
  22.     {
  23.     int ec;
  24.  
  25.     (void) sprintf(buf, "indent %s -lpc", name);
  26.     ec = system(buf);
  27.     unlink(p);
  28.     return(ec == 0);
  29.     }
  30. #endif
  31. }
  32.